<?php
/**
 * Created by .
 * User: luogan
 * Date: 2022/1/17
 */

namespace app\admin\controller\v1;


use app\admin\service\AdminLogService;
use app\admin\validate\AdminLogValidate;
use app\model\BaseModel;
use hg\apidoc\annotation as Apidoc;
/**
 * @Apidoc\Title("操作日志管理")
 * @Apidoc\Group("system")
 * @Apidoc\Sort(5)
 */
class AdminLog extends Base
{

    protected $service;

    protected $validate;

    public function __construct()
    {
        $this->service = new AdminLogService();
        $this->validate = new AdminLogValidate();
    }

    /**
     * @Apidoc\Title("操作日志列表")
     * @Apidoc\Desc("操作日志列表")
     * @Apidoc\Method("POST")
     * @Apidoc\Author("luogan")
     * @Apidoc\Url("v1/operate_log/list")
     * @Apidoc\Tag("操作日志")
     * @Apidoc\Param(ref="pageParam")
     * @Apidoc\Returned(ref="pageParam")
     * @Apidoc\Returned("data", type="array", ref="app\model\AdminLogModel\getList",desc="操作日志列表")
     */
    public function list()
    {
        $data = $this->checkParam(__FUNCTION__);
        $result = $this->service->getList($data);
        return success('操作成功',$result);
    }

    /**
     * @Apidoc\Title("操作日志详情")
     * @Apidoc\Desc("操作日志详情")
     * @Apidoc\Method("POST")
     * @Apidoc\Author("luogan")
     * @Apidoc\Url("v1/operate_log/info")
     * @Apidoc\Tag("操作日志")
     * @Apidoc\Param("id",type="int",require=true,default="1",desc="操作日志id")
     * @Apidoc\Returned(ref="app\model\AdminLogModel\getAdminLog")
     */
    public function info()
    {
        $data = $this->checkParam(__FUNCTION__);
        $result = $this->service->getInfo($data['id']);
        return success('操作成功',$result);
    }


}
